During execution, software often uses resources such as volatile memory (e.g., RAM), non-volatile or persistent memory (e.g., disk space), files (in volatile and/or persistent memory), processor cycles, sockets, peripheral or I/O devices (e.g., transmitters, receivers, scanners, robotic mechanisms), and so on. When a desired use of such a resource is to be exclusive, or when the requested use will be coordinated with other requests, an allocation of the resource typically precedes use of the resource. Allocation made during execution of software is sometimes called “dynamic allocation”. Dynamic allocation of shared resources is managed through resource managers, locks or other access restrictions, and other mechanisms.
For example, software routinely allocates memory for use, and then frees the memory so it can be deallocated by the memory manager and made available for subsequent use, by the same code or another piece of software, in an organized and reliable manner. When memory or another resource is allocated dynamically but not properly freed, the extent of the resource's availability decreases unnecessarily. Loss of resource availability can lead to undesirable results such as slowdowns in execution or even program failure. In such cases of inadequate deallocation of a resource, one speaks of a “leak” occurring in the resource's usage. Various approaches have been taken to prevent, detect, and/or remedy such leaks.